package edu.stthomas.edu.seis770.simpleclock;


public class SetSeconds extends ClockState {
    public SetSeconds(ClockModel clockModel) {
        super(clockModel);
    }

    @Override
    public void timerTick() {
        // Do nothing here since we don't want to update the UI
    }

    @Override
    public void changeMode() {
        //Change the current state to DisplayTime
        ClockState newState = ClockStateFactory.getClockState(DisplayTime.class, clockModel);
        clockModel.setCurrentState(newState);
    }

    @Override
    public void increment() {
        clockModel.setSeconds(clockModel.getSeconds() + 1);
    }

    @Override
    public void decrement() {
        clockModel.setSeconds(clockModel.getSeconds() - 1);
    }

    @Override
    public void cancel() {
        //Change the current state to SetMinutes
        ClockState newState = ClockStateFactory.getClockState(SetMinutes.class, clockModel);
        clockModel.setCurrentState(newState);
    }
}
